/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2016 pjoc.pub, blademainer.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

package pub.pjoc.pay.channels.wechat.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlCData;

/**
 * @author blademainer
 * @version 2016-08-02 14:20
 */
public class OrderResponse extends PayResponseResult {


  //以下字段在return_code 和result_code都为SUCCESS的时候有返回
  /**
   * 交易类型	trade_type	是	String(16)	JSAPI
   * 调用接口提交的交易类型，取值如下：JSAPI，NATIVE，APP，详细说明见参数规定
   */
  @JsonProperty("trade_type")
  @JacksonXmlCData
  private String tradeType;
  /**
   * 预支付交易会话标识	prepay_id	是	String(64)
   * wx201410272009395522657a690389285100	微信生成的预支付回话标识，用于后续接口调用中使用，该值有效期为2小时
   */
  @JsonProperty("prepay_id")
  @JacksonXmlCData
  private String prepayId;
  /**
   * 二维码链接	code_url	否	String(64)	URl：weixin：//wxpay/s/An4baqw
   * trade_type为NATIVE是有返回，可将该参数值生成二维码展示出来进行扫码支付
   */
  @JsonProperty("code_url")
  @JacksonXmlCData
  private String codeUrl;

  public String getTradeType() {
    return tradeType;
  }

  public void setTradeType(String tradeType) {
    this.tradeType = tradeType;
  }

  public String getPrepayId() {
    return prepayId;
  }

  public void setPrepayId(String prepayId) {
    this.prepayId = prepayId;
  }

  public String getCodeUrl() {
    return codeUrl;
  }

  public void setCodeUrl(String codeUrl) {
    this.codeUrl = codeUrl;
  }

  @Override
  public String toString() {
    return "OrderResponse{" +
        "tradeType='" + tradeType + '\'' +
        ", prepayId='" + prepayId + '\'' +
        ", codeUrl='" + codeUrl + '\'' +
        "} " + super.toString();
  }
}
